

import pytest
from API_cases.http_client import HttpClient
from config.env import URLDve,LLM,Unclear
from API_cases.LLM.APIs import login
from utils.logger import log
from utils.decorators import logger


@pytest.fixture(scope='function', autouse=True)
def method():
    method = HttpClient(base_url=f"{URLDve.LLM}")
    yield method

    # while Unclear.user_id:


@pytest.fixture(scope="function", autouse=False)
def get_token(method):

    response = login(method,json = {
        "username": "weichuangxin",
        "password": "xizhi123"
    })
    LLM.access_token = response.json().get("access_token")
    LLM.refresh_token = response.json().get("refresh_token")

